(GH-1393) Rename --version to --required-version for resource commands - #1610
Open
michaeltlombardi wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the dsc resource * CLI surface to use --required-version (instead of --version) for specifying a resource version requirement, aligning the flag name with its actual semantics and addressing #1393.
Changes:
- Renames the resource subcommand argument field from
versiontorequired_version, producing a--required-versionlong flag. - Updates the
resourcesubcommand dispatcher match arms to bindrequired_versionasversionfor downstream calls. - Adds
--versionas a backwards-compatibility alias (currently implemented as a visible alias).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| dsc/src/args.rs | Renames the version option to required_version and adds --version aliasing for resource subcommands. |
| dsc/src/subcommand.rs | Updates match patterns for ResourceSubCommand::* to use required_version bindings. |
michaeltlombardi
force-pushed
the
gh-1393/main/require-version-cli-fields
branch
2 times, most recently
from
July 7, 2026 18:48
31789f0 to
0320aa6
Compare
michaeltlombardi
marked this pull request as ready for review
July 7, 2026 18:58
…source commands Prior to this change, the `dsc resource *` subcommands used the `--version` flag to specify the version requirement for the resource that the command invokes. The option accepts a string which it parses into a `ResourceVersionReq` instance. The name of the option was misleading, as it implied that the user should specify a specific version, like `1.2.3`, when this would actually parse as the version requirement `^1.2.3`, which would match any version `>=1.2.3 <2.0.0`. This change: - Renames the `--version` option to `--required-version` to better reflect the semantics and minimize confusion. - Retains the short option `-v` and aliases the long option `--version` for backward compatibility. - Fixes PowerShell#1393
michaeltlombardi
force-pushed
the
gh-1393/main/require-version-cli-fields
branch
from
July 29, 2026 21:39
a686994 to
039a009
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
dsc/src/args.rs:232
- The new user-facing flag name
--required-versionisn’t currently exercised by tests. Existing PowerShell CLI tests still use--version, which will continue to pass via the alias, but won’t catch regressions where--required-versionstops being recognized (e.g., due to a future clap-derive attribute change). Add/adjust at least one resource command test to use--required-version(and optionally keep one test validating--versionremains accepted for back-compat).
#[clap(short = 'v', long, alias = "version", help = t!("args.version").to_string())]
required_version: Option<ResourceVersionReq>,
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary
This change:
--versionoption to--required-versionto better reflect the semantics and minimize confusion.-vand aliases the long option--versionfor backward compatibility.versionfield fordsc resource *commands torequired_version#1393PR Context
Prior to this change, the
dsc resource *subcommands used the--versionflag to specify the version requirement for the resource that the command invokes. The option accepts a string which it parses into aResourceVersionReqinstance.The name of the option was misleading, as it implied that the user should specify a specific version, like
1.2.3, when this would actually parse as the version requirement^1.2.3, which would match any version>=1.2.3 <2.0.0.